package com.itheima.shengxiao3;

import java.util.concurrent.ArrayBlockingQueue;

public class Demo {

    public static void main(String[] args) {

        ArrayBlockingQueue<String> queue = new ArrayBlockingQueue<>(10);
        Cookie cookie = new Cookie(queue);
        Foodie foodie = new Foodie(queue);

        Thread t1 = new Thread(cookie);
        Thread t2 = new Thread(foodie);
        Thread t3 = new Thread(foodie);
        Thread t4 = new Thread(foodie);
        Thread t5 = new Thread(foodie);
        Thread t6 = new Thread(foodie);
        t1.start();
        t2.start();
        t3.start();
        t4.start();
        t5.start();
        t6.start();

    }
}
